package tw.cuttle.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Action implements Serializable {
    public enum AUTH_TYPE{
	common, 
	none, 
	customize
    }
    /**
     * 
     */
    private static final long serialVersionUID = -2831724390477276544L;
    private String id;
    private String group;
    private String name;
    private String description;
    private String authType=AUTH_TYPE.none.name();
    private String extend;
    private String ajaxExtend;
    private String layout;
    private String form;
    private List<Process> processes;
    private List<ActionException> exceptions;
    private String preExec;
    
    public String getPreExec() {
		return preExec;
	}
	public void setPreExec(String preExec) {
		this.preExec = preExec;
	}
	/**
     * @return the group
     */
    public String getGroup() {
        return group;
    }
    /**
     * @param group the group to set
     */
    public void setGroup(String group) {
        this.group = group;
    }
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
    /**
     * @return the authType
     */
    public String getAuthType() {
        return authType;
    }
    /**
     * @param authType the authType to set
     */
    public void setAuthType(String authType) {
        this.authType = authType;
    }
    /**
     * @return the form
     */
    public String getForm() {
        return form;
    }
    /**
     * @param form the form to set
     */
    public void setForm(String form) {
        this.form = form;
    }
    /**
     * @return the exceptions
     */
    public List<ActionException> getExceptions() {
        return exceptions;
    }
    /**
     * @param exceptions the exceptions to set
     */
    public void setExceptions(List<ActionException> exceptions) {
        this.exceptions = exceptions;
    }
    /**
     * @return the id
     */
    public String getId() {
        return id;
    }
    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }
    /**
     * @return the extend
     */
    public String getExtend() {
        return extend;
    }
    /**
     * @param extend the extend to set
     */
    public void setExtend(String extend) {
        this.extend = extend;
    }
    /**
     * @return the ajaxExtend
     */
    public String getAjaxExtend() {
        return ajaxExtend;
    }
    /**
     * @param ajaxExtend the ajaxExtend to set
     */
    public void setAjaxExtend(String ajaxExtend) {
        this.ajaxExtend = ajaxExtend;
    }
    /**
     * @return the layout
     */
    public String getLayout() {
        return layout;
    }
    /**
     * @param layout the layout to set
     */
    public void setLayout(String layout) {
        this.layout = layout;
    }
    /**
     * @return the processes
     */
    public List<Process> getProcesses() {
        return processes;
    }
    /**
     * @param processes the processes to set
     */
    public void setProcesses(List<Process> processes) {
        this.processes = processes;
    }
    public void addProcess(Process process){
	if(processes==null)processes=new ArrayList<Process>();
	processes.add(process);
    }
    public void addException(ActionException exception){
	if(exceptions==null)exceptions=new ArrayList<ActionException>();
	exceptions.add(exception);
    }
}
